from flask import Flask
from config.config import Config
from .models import *
from .models.models import *

def create_application(name):
    app = Flask(name)
    app.config.from_object(Config)
    app.debug = app.config['DEBUG']

    from .home import home
    app.register_blueprint(home)

    with app.app_context():
        db.init_app(app)
        db.create_all()

    return app
